@echo off
setlocal ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION

:: bootstrap
pushd %~dp0
call _configure.bat
popd

cls

set TARGET_JS_PATH=%1
set TARGET_DIR_TEST=%~sf1\nul

if defined TARGET_JS_PATH (
	
	set TARGET_PATH=%BRANCH_HOSTING_PATH%\src\%TARGET_JS_PATH%
	
) else (
	
	set TARGET_PATH=%BRANCH_HOSTING_PATH%\src
	
)
if not exist %TARGET_PATH% (
	echo file/directory do exist: %TARGET_PATH%
	goto :end
)

pushd %TARGET_PATH% >NUL 2>&1
if %ERRORLEVEL% EQU 0 (
	echo checking directory: %TARGET_PATH%
	echo.
	popd
	gjslint -r %TARGET_PATH%
) else (
	echo checking file: %TARGET_PATH%
	echo.
	gjslint %TARGET_PATH%
)


:end
endlocal